<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 可判断字符型和数字等
        var res=["爸爸","儿子","闺女"];
        var res=[1,2,3,4]
        var sum=res.indexOf(9);
    console.log(sum);
    </script>
</body>
</html>